package ${packName};

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.simpleframe.persistence.hibernate.Page;
import com.simpleframe.persistence.hibernate.Searcher;
import ${pojoClassName};
import ${daoClassName};

public class ${name} {

	@Autowired
	private ${daoName} ${daoInstanceName};
	
	public ${pojoName} getById(long id){
		return ${daoInstanceName}.findById(id);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void deletes(Long[] ids){
		${daoInstanceName}.deletes(ids);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void create(${pojoName} ${pojoInstanceName}){
		${daoInstanceName}.save(${pojoInstanceName});
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void update(${pojoName} ${pojoInstanceName}){
		${daoInstanceName}.update(${pojoInstanceName});
	}
	
	//以上自动生成
	
	public Page getPage(Searcher searcher){
		return ${daoInstanceName}.getPage(searcher);
	}

}
